<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>预约挂号模块类图</title>
    <script src="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.js"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/mermaid@10.6.1/dist/mermaid.min.css">
    <style>
        body {
            font-family: 'Arial', sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 20px;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        .container {
            background-color: white;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            padding: 20px;
            margin-bottom: 20px;
            max-width: 1100px;
            width: 100%;
        }
        h1 {
            color: #2c3e50;
            text-align: center;
            margin-bottom: 30px;
        }
        .mermaid {
            margin: 30px 0;
            display: flex;
            justify-content: center;
        }
        .mermaid svg {
            max-width: 100%;
            height: auto;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>预约挂号模块类图</h1>
        <div class="mermaid">
            classDiagram
                class Appointment {
                    +Long id
                    +Long patientId
                    +Long doctorId
                    +Long departmentId
                    +LocalDateTime appointmentTime
                    +String status
                    +String description
                    +createTime
                    +updateTime
                    +createAppointment()
                    +cancelAppointment()
                    +updateStatus()
                }
                
                class DoctorSchedule {
                    +Long id
                    +Long doctorId
                    +Long departmentId
                    +LocalDate scheduleDate
                    +String period
                    +Integer maxAppointments
                    +Integer availableAppointments
                    +String status
                    +createTime
                    +updateTime
                    +checkAvailability()
                    +updateAvailableAppointments()
                }
                
                class Doctor {
                    +Long id
                    +Long userId
                    +Long departmentId
                    +String name
                    +String title
                    +String specialty
                    +String introduction
                    +String photoUrl
                    +String status
                    +createTime
                    +updateTime
                    +getSchedule()
                    +updateSchedule()
                }
                
                class Department {
                    +Long id
                    +String name
                    +String description
                    +String status
                    +createTime
                    +updateTime
                    +getDoctors()
                    +addDoctor()
                }
                
                class AppointmentController {
                    +createAppointment()
                    +cancelAppointment()
                    +getAppointmentList()
                    +getAppointmentDetail()
                }
                
                class AppointmentService {
                    +createAppointment()
                    +cancelAppointment()
                    +getAppointmentList()
                    +getAppointmentDetail()
                }
                
                class DoctorScheduleController {
                    +createSchedule()
                    +updateSchedule()
                    +getScheduleList()
                    +getScheduleDetail()
                }
                
                class DoctorScheduleService {
                    +createSchedule()
                    +updateSchedule()
                    +getScheduleList()
                    +getScheduleDetail()
                }
                
                Appointment "1" *-- "1" Doctor : belongs to
                Appointment "1" *-- "1" Department : belongs to
                Doctor "1" *-- "N" DoctorSchedule : has
                Department "1" *-- "N" Doctor : has
                AppointmentController --> AppointmentService : uses
                DoctorScheduleController --> DoctorScheduleService : uses
                AppointmentService --> DoctorScheduleService : uses
        </div>
    </div>
    <script>
        mermaid.initialize({
            theme: 'default',
            startOnLoad: true,
            securityLevel: 'loose',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true
            }
        });
    </script>
</body>
</html> 